import { createApp } from "vue";
import "./style.css";
import "vant/lib/index.css";
import App from "./App.vue";
import router from "./router";
import { initRem } from "./utils/rem";
import { createPinia } from "pinia";
import piniaPluginPersistedstate from "pinia-plugin-persistedstate";
initRem();
//declare提供类型声明
declare module "@vue/runtime-core" {
  interface ComponentCustomProperties {
    $myLog: () => void; //让自定义挂载的全局方法，在vue运行环境中拥有类型申明
  }
}
let pinia = createPinia();
pinia.use(piniaPluginPersistedstate); //挂载pinia插件
let app = createApp(App);
app.use(pinia);
app.use(router);
app.config.globalProperties.$myLog = () => {
  //挂载全局方法
  console.log("这是一个全局的方法");
};
app.mount("#app");
